package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

import java.util.Map;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello(String name, int timeToWait) {
        Map<String, String> attachments = RpcContext.getContext().getAttachments();
        String ip = attachments.get("ip");
        System.out.println("sayHello 02 ip : " + ip);
        return "hello:"+name;
    }
}
